namespace EntLibEC.View.Cmn
{
	using System;
	using System.Data;
	using System.Drawing;
	using System.Web;
	using System.Web.UI.WebControls;
	using System.Web.UI.HtmlControls;

	using EntLibEC.Cmn;
	using EntLibEC.Info.Basic;
	using EntLibEC.Biz.Basic;

	/// <summary>
	///		Summary description for UserPickUp.
	/// </summary>
	public partial class User : System.Web.UI.UserControl
	{

		protected void Page_Load(object sender, System.EventArgs e)
		{
			txtUserID.Attributes.Add("onkeydown","if(event.keyCode==13){return false;}");
			lnkSearch.Attributes["onclick"]= "javascript:openWindowS3('../Cmn/UserPickUp.aspx?clientID=" + this.ClientID + "'); return false;";
		}

		public int UserSysNo
		{
			get
			{	
				if ( txtUserID.Text.Trim() != "" )
				{
					string userID = txtUserID.Text.Trim();
					UserInfo oUser = SysManager.GetInstance().LoadUser(userID);
					if ( oUser == null )
						return AppConst.IntNull;

					txtUserSysNo.Text = oUser.SysNo.ToString();
					txtUserName.Text = oUser.UserName;
					return oUser.SysNo;
				}
				else
				{
					txtUserSysNo.Text = "";
					txtUserName.Text = "";
					return AppConst.IntNull;
				}
			}
			set
			{
				UserInfo oUser = SysManager.GetInstance().LoadUser(value);
				
				txtUserSysNo.Text = oUser.SysNo.ToString();
				txtUserID.Text = oUser.UserID;
				txtUserName.Text = oUser.UserName;
			}
		}
		public bool Enabled
		{
			set
			{
				txtUserID.Enabled = value;
			}
		}

		#region Web Form Designer generated code
		override protected void OnInit(EventArgs e)
		{
			//
			// CODEGEN: This call is required by the ASP.NET Web Form Designer.
			//
			InitializeComponent();
			base.OnInit(e);
		}
		
		/// <summary>
		///		Required method for Designer support - do not modify
		///		the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{

		}
		#endregion
	}
}
